import os
import sys
import common
import webapp
import subprocess
import contextlib
from appenv import AppEnv
from ui_backend import UIBackend
import asyncio


def main():
    app_env = AppEnv()
    app = webapp.WebApp(app_env)
    ui_backend = UIBackend(app_env)
    loop = asyncio.new_event_loop()
    app.run_app_in_loop(loop)
    ui_backend.run_app_in_loop(loop)
    loop.run_forever()

if __name__ == "__main__":
    main()
